package com.power.using.mydaggerp.base;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.NonNull;

import me.yokeyword.fragmentation.SupportFragment;

/**
 * Created by 聪明一只哈 on 2019/10/10.
 * Time: 2019/10/10  17:06
 */
public interface IBaseFragment extends IBaseView{


    /**
     * 出栈到目标fragment
     * @param targetFragmentClass 目标fragment
     * @param includeTargetFragment
     */
    void popToFragment(Class<?> targetFragmentClass,boolean includeTargetFragment);

    /**
     * 跳转到新的Fragment
     * @param supportFragment 要跳往的Fragment(继承自supportFragment)
     */
    void startNewFragment(@NonNull SupportFragment supportFragment);

    /**
     * 跳往新的Fragment,并出栈当前fragment
     * @param supportFragment 要跳往的Fragment(继承自supportFragment)
     */
    void startNewFragmentWithPop(@NonNull SupportFragment supportFragment);

    /**
     * 跳往新的Fragment
     * @param supportFragment 要跳往的Fragment(继承自supportFragment)
     * @param requestCode       requestCode
     */
    void startNewFragmentForResult(@NonNull SupportFragment supportFragment,int requestCode);


    /**
     * 设置Fragment返回Result
     * @param resultCode
     * @param data
     */
    void setOnFragmentResult(int resultCode,Bundle data);


    /**
     * 跳往新的Activity
     * @param clz
     */
    void startNewActivity(@NonNull Class<?> clz);

    /**
     * 跳往新的Activity
     * @param clz
     * @param bundle 携带的bundle数据
     */
    void startNewActivity(Class<?> clz,Bundle bundle);


    /**
     * 跳往新的Activity
     * @param clz
     * @param bundle    bundel数据
     * @param requestCode   requestCode
     */
    void startNewActivityForResult(@NonNull Class<?> clz,Bundle bundle,int requestCode);


    /**
     * 返回当前fragment是否可见
     * @return
     */
    boolean isVisiable();

    /**
     * 返回当前fragment绑定的activity
     * @return
     */
    Activity getBindActivity();
}
